package com.ok.common.exception

import com.ok.common.base.IBaseResponse

open class ResponseException : Exception {
    var code: Int
    var msg: String

    constructor(errorCode: ErrorCode, e: Throwable? = null) : super(e) {
        code = errorCode.code
        msg = errorCode.err
    }

    constructor(code: Int, msg: String, e: Throwable? = null) : super(e) {
        this.code = code
        this.msg = msg
    }

    constructor(base: IBaseResponse<*>, e: Throwable? = null) : super(e) {
        this.code = base.code()
        this.msg = base.msg()
    }
}

